{**
 * index.tpl
 *
 * Copyright (c) 2003-2012 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *http://localhost/DUOCTU3/index.php/index/admin/settings
 * User index.
 *
 * $Id$
 {call_hook name="Templates::User::Index::Site"}
 *}
{strip}
{assign var="pageTitle" value="user.userHome"}
{include file="common/header.tpl"}
{/strip}


{if $isSiteAdmin}
	{assign var="hasRole" value=1}
	<ul class="plain">
	<li>
	&#187;<a href="{url journal="index" page="admin" op="journals"}">Quản trị thông tin Công ty</a></li>

	<li>
	&#187;<a href="{url page="acctKT" op="KT_DMDVCS"}">Các đơn vị - phòng ban (ĐVCS)</a></li>
	</ul>
	
	<div id="managerUsers">
	<h3>{translate key="manager.users"}</h3>

	<ul class="plain">
		<li>&#187; <a href="{url page= "manager" op="people" path="all"}">{translate key="manager.people.allEnrolledUsers"}</a></li>
		<li>&#187; <a href="{url page= "manager" op="enrollSearch"}">{translate key="manager.people.allSiteUsers"}</a></li>
		<li>&#187; <a href="{url page= "manager" op="showNoRole"}">{translate key="manager.people.showNoRole"}</a></li>
		{url|assign:"managementUrl" page="manager"}
		<li>&#187; <a href="{url op="createUser" source=$managementUrl}">{translate key="manager.people.createUser"}</a></li>
		<li>&#187; <a href="{url op="mergeUsers"}">{translate key="manager.people.mergeUsers"}</a></li>
		{call_hook name="Templates::Manager::Index::Users"}
	</ul>
	</div>
	<div id="managerRoles">
	<h3>{translate key="manager.roles"}</h3>

	<ul class="plain">
		<li>&#187; <a href="{url page= "manager" op="people" path="managers"}">{translate key="user.role.managers"}</a></li>

		<li>&#187; <a href="{url page= "manager" op="people" path="ThuChiCNs"}">{translate key="user.role.ThuChiCN"}</a></li>

		<li>&#187; <a href="{url page= "manager" op="people" path="ThuChiViews"}">{translate key="user.role.ThuChiView"}</a></li>

		<li>&#187; <a href="{url page= "manager" op="people" path="BanHangCNs"}">{translate key="user.role.BanHangCN"}</a></li>

		<li>&#187; <a href="{url page= "manager" op="people" path="BanHangViews"}">{translate key="user.role.BanHangView"}</a></li>

		<li>&#187; <a href="{url page= "manager" op="people" path="MuaHangCNs"}">{translate key="user.role.MuaHangCN"}</a></li>

		<li>&#187; <a href="{url page= "manager" op="people" path="MuaHangViews"}">{translate key="user.role.MuaHangView"}</a></li>

		{call_hook name="Templates::Manager::Index::Roles"}
	</ul>
	</div>

{/if}

{if !$hasRole}
	{if $currentJournal}
		<div id="noRolesForJournal">
		<p>{translate key="user.noRoles.noRolesForJournal"}</p>
		<ul class="plain">
			<li>
				&#187;
				{if $allowRegAuthor}
					{url|assign:"submitUrl" page="author" op="submit"}
					<a href="{url op="become" path="author" source=$submitUrl}">{translate key="user.noRoles.submitArticle"}</a>
				{else}{* $allowRegAuthor *}
					{translate key="user.noRoles.submitArticleRegClosed"}
				{/if}{* $allowRegAuthor *}
			</li>
			<li>
				&#187;
				{if $allowRegReviewer}
					{url|assign:"userHomeUrl" page="user" op="index"}
					<a href="{url op="become" path="reviewer" source=$userHomeUrl}">{translate key="user.noRoles.regReviewer"}</a>
				{else}{* $allowRegReviewer *}
					{translate key="user.noRoles.regReviewerClosed"}
				{/if}{* $allowRegReviewer *}
			</li>
		</ul>
		</div>
	{else}{* $currentJournal *}
		<div id="currentJournal">
		<p>{translate key="user.noRoles.chooseJournal"}</p>
		<ul class="plain">
			{foreach from=$allJournals item=thisJournal}
				<li>&#187; <a href="{url journal=$thisJournal->getPath() page="user" op="index"}">{$thisJournal->getLocalizedTitle()|escape}</a></li>
			{/foreach}
		</ul>
		</div>
	{/if}{* $currentJournal *}
{/if}{* !$hasRole *}

<div id="myAccount">
<h3>{translate key="user.myAccount"}</h3>
<ul class="plain">
<!--
	{if $hasOtherJournals}
		{if !$showAllJournals}
			<li>&#187; <a href="{url journal="index" page="user"}">{translate key="user.showAllJournals"}</a></li>
		{/if}
	{/if}
-->
	{if $currentJournal}
		{if $subscriptionsEnabled}
			<li>&#187; <a href="{url page="user" op="subscriptions"}">{translate key="user.manageMySubscriptions"}</a></li>
		{/if}
	{/if}
	<li>&#187; <a href="{url page="user" op="profile"}">{translate key="user.editMyProfile"}</a></li>

	{if !$implicitAuth}
		<li>&#187; <a href="{url page="user" op="changePassword"}">{translate key="user.changeMyPassword"}</a></li>
	{/if}

	{if $currentJournal}
		{if $journalPaymentsEnabled && $membershipEnabled}
			{if $dateEndMembership}
				<li>&#187; <a href="{url page="user" op="payMembership"}">{translate key="payment.membership.renewMembership"}</a> ({translate key="payment.membership.ends"}: {$dateEndMembership|date_format:$dateFormatShort})</li>
			{else}
				<li>&#187; <a href="{url page="user" op="payMembership"}">{translate key="payment.membership.buyMembership"}</a></li>		
			{/if}
		{/if}{* $journalPaymentsEnabled && $membershipEnabled *}
	{/if}{* $userJournal *}

	<li>&#187; <a href="{url page="login" op="signOut"}">{translate key="user.logOut"}</a></li>
	{call_hook name="Templates::User::Index::MyAccount"}
</ul>
</div>

{include file="common/footer.tpl"}

